import type { TableProps } from "tdesign-vue-next";
import dayjs from "dayjs";

export const tableColumns = [
  {
    colKey: "orderId",
    title: "订单号",
    width: 200
  },
  {
    colKey: "hasExpress",
    title: "出运状态",
    width: 150,
    cell: (h, { row }) => {
      return row.hasExpress ? "已出运" : "未出运";
    }
  },
  {
    colKey: "orderCustomerId",
    title: "客户名称",
    width: 220,
    cell: (h, { row }) => {
      return row.customer?.name;
    }
  },
  {
    colKey: "orderName",
    title: "订单名称",
    width: 220
  },
  {
    colKey: "deliveryTerm",
    title: "交货期限",
    width: 220,
    cell: (h, { row }) => {
      return dayjs(row.deliveryTerm).format("YYYY-MM-DD HH:mm:ss");
    }
  },
  {
    colKey: "loadPort",
    title: "装运口岸",
    width: 220
  },
  {
    colKey: "unloadPort",
    title: "运抵港",
    width: 220
  }
] as TableProps["columns"];
